package co.yixiang.common.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;

@Data
@Validated
@Component
public class WebProperties {

    /**
     * api包下统一前缀
     */
    Api buyer = new Api("buyer", "**.controller.buyer.**");

    /**
     * admin包下统一前缀
     */
    Api admin = new Api("", "**.controller.manager.**");
    Api common = new Api("common", "**.controller.common.**");

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Api {

        @NotBlank
        private String prefix;

        @NotBlank
        private String controllerPath;
    }

}
